package com.example.javabasic.shejimoshi.danli.demo2;
//懒汉   懒加载
public class Singleton {

    private static volatile Singleton instance ;
    private Singleton(){};

    public static synchronized Singleton getInstance(){
        if(instance == null){
            instance = new Singleton();
        }
        return instance;
    }

}
